<!DOCTYPE html>
<html>

<head>
  <meta charset="utf-8">
  <meta name="renderer" content="webkit|ie-comp|ie-stand">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
  <meta http-equiv="Cache-Control" content="no-siteapp" />
  <title>出库给客户</title>
</head>

<body>
  <div id="app">
    <div class="outWarehouse-mgr">
      <el-tabs v-model="activeMenu" class="finishMaterial full-tabs">
        <el-tab-pane lazy v-for="menu in menus" :key="menu.name" :label="menu.label" :name="menu.name">
          <component :customer-list="customerList" :is="menu.url" :reset-customer="setCustomerList" class="menu-item">
          </component>
        </el-tab-pane>
      </el-tabs>
    </div>
  </div>
</body>

<script src="myJs/importFile.js"></script>
<script>
  importFile([
    "/vueSystem/components/css/sysCommonSearch.css",
    "/vueSystem/components/css/searchBtnView.css",
    "./warehouse/finishProductOut/instalmentOut/instalmentOut.css",
    "./warehouse/finishProductOut/css/materialOut.css"
    // "/warehouse/finishProductOut/css/blankMaterialOut.css"
  ], [
    "/vueSystem/i18n/index.js",
    "/vueSystem/js/permissionUtil.js",
    "/vueSystem/js/checkVaildUtil.js",
    "/vueSystem/js/storageUtil.js",
    "/vueSystem/components/sysCommonSearch.js",
    "/vueSystem/components/searchBtnView.js",
    "/vueSystem/models/baseModel.js",
    "/vueSystem/mixins/tablePaginationMixin.js"
  ]);

</script>
<script src="purchaseOrder/models/customerModel.js"></script>
<script src="purchaseOrder/customer/customerForm.js"></script>
<script src="./warehouse/finishProductOut/instalmentOut/index.js"></script>
<script src="./warehouse/finishProductOut/instalmentOut/instalmentOutMixin.js"></script>

<script src="./warehouse/finishProductOut/materialOut.js"></script>
<!-- <script src="warehouse/finishProductOut/blankMaterialOut.js"></script> -->

<script>
  var app = new Vue({
    el: "#app",
    data: function () {
      return {
        activeMenu: 'materialOut',
        menus: [{
            label: "原材料出库",
            name: "materialOut",
            url: "material-out"
          }
          // , {
          //   label: "半成品出库",
          //   name: "blankMaterialOut",
          //   url: "blank-material-out"
          // }
        ],
        customerList: []
      };
    },
    created: function () {
      this.setCustomerList();
    },
    methods: {
      //查询客户
      setCustomerList: function () {
        var self = this;
        self.loading = true;
        return ajaxRequest("basicData/getCustomerCode", {
          type: 2,
          view: 1
        }).then(function (data) {
          self.loading = false;
          var customerList = _.map(data, function (obj) {
            var isTax = obj.isTax;
            if (isTax === 0) {
              isTax = 2;
            }
            return {
              customerCode: obj.customerCode,
              customerName: obj.customerName,
              isTax: isTax
            };
          });
          self.customerList = customerList
          return customerList;
        }).catch(function (error) {
          self.loading = false;
        });
      }
    },
    components: {
      MaterialOut: MaterialOut,
      // BlankMaterialOut: BlankMaterialOut
    }
  });

</script>
<style>
  .outWarehouse-mgr {
    padding-left: 20px;
    height: 100%;
  }

</style>

</html>
